package arena.utils;

import arena.soldier.ArmedUnit;
import arena.soldier.ArmedUnitSoldier;

public class ObserverEnrage implements Observer<ArmedUnit>{
	
	private static ObserverEnrage uniqueInstance;
	static final int ENRAGE_DURATION = 80;
	
	private ObserverEnrage() {}
	
	public static synchronized ObserverEnrage getInstance() {
		if (uniqueInstance == null)
			uniqueInstance = new ObserverEnrage();
		return uniqueInstance;
	}
	
	public void update(ArmedUnit s) {
		ArmedUnitSoldier soldier = (ArmedUnitSoldier)s;
		soldier.setEnrage(ENRAGE_DURATION);
	}
}
